package com.hsy.crm.web.config;

import com.hsy.crm.web.domain.entity.User;
import com.hsy.crm.web.utils.UuidUtils;
import org.apache.shiro.authc.AuthenticationToken;

public class CrmAuthenticationToken implements AuthenticationToken {

    private User user;
    private Long credentials;

    public CrmAuthenticationToken(User user) {
        this.user = user;
        this.credentials = UuidUtils.getUuid();
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public Object getPrincipal() {
        return this.user;
    }

    @Override
    public Object getCredentials() {
        return this.credentials;
    }
}
